﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;

namespace QuanLyGiaoVuDAL.ADOWrapper
{
    public class DBParameterFactory
    {
        public static SqlParameter Create(string parameterName, SqlDbType type, object value)
        {
            SqlParameter parameter = new SqlParameter();
            parameter.ParameterName = "@" + parameterName.Trim('@');
            parameter.SqlDbType = type;
            parameter.Value = value;
            return parameter;
        }

        public static SqlParameter Create(string parameterName, object value)
        {
            return new SqlParameter("@" + parameterName.Trim('@'), value);
        }
    }
}
